/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.spider.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * Spider配置Entity
 * @author hongye
 * @version 2017-04-12
 */
public class SpiderConfig extends DataEntity<SpiderConfig> {
	
	private static final long serialVersionUID = 1L;
	private String spiderId;		// spider_id
	private Integer threadNumber;		// 线程数量
	private Integer retryTimes;		// 重试次数
	private Integer retrySleeptime;		// 重试间隔时间
	private Integer sleeptime;		// 睡眠时间
	
	public SpiderConfig() {
		super();
	}

	public SpiderConfig(String id){
		super(id);
	}

	@Length(min=1, max=100, message="spider_id长度必须介于 1 和 100 之间")
	public String getSpiderId() {
		return spiderId;
	}

	public void setSpiderId(String spiderId) {
		this.spiderId = spiderId;
	}
	
	@NotNull(message="线程数量不能为空")
	public Integer getThreadNumber() {
		return threadNumber;
	}

	public void setThreadNumber(Integer threadNumber) {
		this.threadNumber = threadNumber;
	}
	
	@NotNull(message="重试次数不能为空")
	public Integer getRetryTimes() {
		return retryTimes;
	}

	public void setRetryTimes(Integer retryTimes) {
		this.retryTimes = retryTimes;
	}
	
	@NotNull(message="重试间隔时间不能为空")
	public Integer getRetrySleeptime() {
		return retrySleeptime;
	}

	public void setRetrySleeptime(Integer retrySleeptime) {
		this.retrySleeptime = retrySleeptime;
	}
	
	@NotNull(message="睡眠时间不能为空")
	public Integer getSleeptime() {
		return sleeptime;
	}

	public void setSleeptime(Integer sleeptime) {
		this.sleeptime = sleeptime;
	}
	
}